<%
Date.prototype.Format = function (fmt) { //author: meizz 
var o = {
    "M+": this.getMonth() + 1, //月份 
    "d+": this.getDate(), //日 
    "h+": this.getHours(), //小时 
    "m+": this.getMinutes(), //分 
    "s+": this.getSeconds(), //秒 
    "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
    "S": this.getMilliseconds() //毫秒 
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}

%>
                    <% if(todos.length == 0){ %>
                    <li>
                        <div class="task-title">
                            <span style="padding-left:20px;">&nbsp;</span>
                            <span class="task-title-sp">
                            Not any data...
                            </span>
                        </div>
                    </li>
                    <% } %>

<%  todos.forEach( function( todo, index ){ %>
                    <li id="li_<%= todo._id %>" <% if(todo.is_done){ %>class="task-done"<%}%> data-toggle="collapse" data-target="#task_content_<%=todo._id%>">
                        <div class="task-title">
                            <span class="task-star margin-left-6">
                            <% if (curType == siteType.todo){%>
                            <% if(todo.is_star){ %>
                                <i name="btnStar" data-id="<%=todo._id%>" class="glyphicon glyphicon-star font-star"></i>
                            <% }else{ %>
                                <i name="btnStar" data-id="<%=todo._id%>" class="glyphicon glyphicon-star-empty"></i>
                            <% } %>
                            <% }else{ %>
                                <i>&nbsp;</i>
                            <% } %>
                            </span>
                            <% if (curType == siteType.todo){%>
                            <span class="task-title-sp margin-left-6">
                                [<%= todo.last_modified_date.Format("yyyy-MM-dd  hh:mm")%>]
                            </span>
                            <% } %>
                            <span class="task-title-sp margin-left-6">
                                <% if (curType == siteType.tag){%>
                                <span class='padding-5-30 badge badge-sm badge-<%= todo.class_name %>'><%= todo.title %></span>

                                <span class='padding-5-30 badge badge-sm' style="background-color:<%= todo.color %>;"><%= todo.title %></span>
                                <% }else{ %>
                                <%= todo.title %>
                                <% } %>

                            </span>
                            <% if(todo.tag_ids){ %>
                            <% todo.tag_ids.forEach( function( tag, index ){ %>
                            <span class="badge badge-sm badge-<%=tag.class_name%> margin-left-6">
                                <%= tag.title %>
                            </span>
                            <% });} %>
                            <% if (curType == siteType.todo){%>
                            <span class="task-bell margin-left-6">
                                <i class="glyphicon glyphicon-bell font-purple"></i>
                            </span>
                            <% } %>
                        </div>

                        <% if(todo.is_edit){ %>
                        <div class="task-action">                        
                            <a name="btnEdit" href="javascript:void(0);" data-id="<%=todo._id%>">Edit</a>
                            &nbsp;
                            <% if (curType == siteType.todo && !todo.is_done){%>
                            <a name="btnDone" href="javascript:void(0);" data-id="<%=todo._id%>">Done</a>
                            &nbsp;
                            <% } %>
                            <a name="btnDel" href="javascript:void(0);" data-id="<%=todo._id%>">Delete</a>
                        </div>
                        <% } %>
                    </li>   
                    <% if(todo.content){ %>
                    <div class="highlight collapse" id="task_content_<%=todo._id%>">
                        <pre><code class="html"><%= todo.content %></code></pre>
                    </div>
                    <% } %>         
                    <% }); %>